package flychess.controller;

import flychess.entity.Player;

public class GameDisplay {
    /**
     * 打印游戏开始的信息
     */
    public static void enterGame() {
        System.out.println("**************************************************************");
        System.out.println("*                                                            *");
        System.out.println("*                                                            *");
        System.out.println("*                         飞行棋游戏                           *");
        System.out.println("*                                                            *");
        System.out.println("*                                                            *");
        System.out.println("**************************************************************");
    }

    public static void gameOver() {
        System.out.println("\n\n\n");
        System.out.print("****************************************************\n");
        System.out.print("                      Game  Over                    \n");
        System.out.print("****************************************************\n\n");
    }

    public static void gameStart() {
        System.out.print("\n**************************************************************\n");
        System.out.print("*                        Game Start                          *\n");
        System.out.print("**************************************************************\n");
    }

    /**
     * 输出获胜的玩家
     */
    public static void printWinner(Player player) {
        System.out.println("\n恭喜" +player.getPlayerName() + "玩家! 您获胜了！");
    }

    /**
     * 输出选项
     */
    public static void printOptions(String title, String[] options) {
        System.out.printf("请选择%s：", title);
        for (int i = 0; i < options.length; i++) {
            System.out.print((i + 1) + ": ");
            System.out.print(options[i] + "  ");
        }
        System.out.println();
    }

    /**
     * 掷骰子的结果
     * @param player 玩家
     * @param rival 对手
     * @param step 骰子数
     */
    public static void rollDiceResult(Player player, Player rival, int step) {
        System.out.println("-----------------"); // 显示结果信息
        System.out.println(player.getPlayerName() + "刚才得到的骰子数： " + step);
        printPlayerPos(player);
        printPlayerPos(rival);
        System.out.println("-----------------");
    }
    public static void printPlayerPos(Player player) {
        System.out.println(player.getPlayerName() + "(" +
                player.getPlayerSemiIcon() + ")当前位置：" + player.getPlayerPos());
    }
    public static void pause(Player player) {
        System.out.println("\n" + player.getPlayerName() + "停掷一次！\n"); // 显示此次暂停信息
    }
}
